#include<stdio.h>
#include<stdlib.h>
#include<conio.h>

int find(char *N, char *M)
 {
    char *p=N;
    char *q=M;
    int i=0,j=0;
    while(p!=NULL)
    {
        if(*q==0) break;
        else
		{
            if(*p==*q)
            {
                p++; q++; i++; j++;
            }
            else
            {
                p++; q=q-i; i=0; j++;
            }
        }
    }
    return j-i+1;    
}

 int  main()
 {
    char *N="adsdfadagfaghfahgjsarewragfjsgjsgmcvhjtyijhgjd";
    char *M="jhg";
    int i;
    i=find(N,M);
    printf("%d ",i);
    getch();
    return 0;
}

